<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta charset="utf-8"/>
    <title>    OneLogin&#039;s SAML PHP Toolkit &raquo; \OneLogin_Saml2_Utils
</title>
    <meta name="author" content=""/>
    <meta name="description" content=""/>

            <link href="../css/template.css" rel="stylesheet" media="all"/>
    
            <!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
        <![endif]-->
        <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>
        <script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script>
        <script src="../js/bootstrap.js" type="text/javascript"></script>
        <script src="../js/template.js" type="text/javascript"></script>
        <script src="../js/prettify/prettify.min.js" type="text/javascript"></script>
    
            <link rel="shortcut icon" href="../img/favicon.ico"/>
        <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"/>
        <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"/>
        <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"/>
    </head>
<body>

        <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span> <span class="icon-bar"></span>
                    <span class="icon-bar"></span> </a>
                <a class="brand" href="../index.html">OneLogin&#039;s SAML PHP Toolkit</a>

                <div class="nav-collapse">
                    <ul class="nav">
                        <li class="dropdown">
                            <a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                API Documentation <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                                                                            </ul>
                        </li>
                        <li class="dropdown" id="classes-menu">
                            <a href="../namespaces/default.html">Classes</a>
                        </li>                         
                        <li class="dropdown" id="charts-menu">
                            <a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                Charts <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../graph_class.html">
                                        <i class="icon-list-alt"></i>&#160;Class hierarchy diagram
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="go_to_top">
            <a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>
        </div>
    </div>
    
    <div id="___" class="container">
        <noscript>
            <div class="alert alert-warning">
                Javascript is disabled; several features are only available if Javascript is enabled.
            </div>
        </noscript>

        
            <style>
        .deprecated h2 {
            text-decoration: line-through;
        }
    </style>
    <div class="row">
        <div class="span4">
                    <div class="btn-group view pull-right" data-toggle="buttons-radio">
        <button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button>
        <button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
    </div>
    <div class="btn-group visibility" data-toggle="buttons-checkbox">
        <button class="btn public active" title="Show public elements">Public</button>
        <button class="btn protected" title="Show protected elements">Protected</button>
        <button class="btn private" title="Show private elements">Private</button>
        <button class="btn inherited active" title="Show inherited elements">Inherited</button>
    </div>

        <ul class="side-nav nav nav-list">
        <li class="nav-header">
            <i class="icon-custom icon-method"></i> Methods
            <ul>
                                                                                                    <li class="method public">
        <a href="#method_t" title="t :: Translates any string. Accepts args">
            <span class="description">Translates any string. Accepts args</span><pre>t</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_validateXML" title="validateXML :: This function attempts to validate an XML string against the specified schema.">
            <span class="description">This function attempts to validate an XML string against the specified schema.</span><pre>validateXML</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_formatCert" title="formatCert :: Returns a x509 cert (adding header &amp; footer if required).">
            <span class="description">Returns a x509 cert (adding header &amp; footer if required).</span><pre>formatCert</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_formatPrivateKey" title="formatPrivateKey :: Returns a private key (adding header &amp; footer if required).">
            <span class="description">Returns a a private key (adding header &amp; footer if required).</span><pre>formatPrivateKey</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_redirect" title="redirect :: Executes a redirection to the provided url (or return the target url).">
            <span class="description">Executes a redirection to the provided url (or return the target url).</span><pre>redirect</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_getSelfURLhost" title="getSelfURLhost :: Returns the protocol + the current host + the port (if different than
common ports).">
            <span class="description">Returns the protocol + the current host + the port (if different than
common ports).</span><pre>getSelfURLhost</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_getSelfHost" title="getSelfHost :: Returns the current host.">
            <span class="description">Returns the current host.</span><pre>getSelfHost</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_isHTTPS" title="isHTTPS :: Checks if https or http.">
            <span class="description">Checks if https or http.</span><pre>isHTTPS</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_getSelfURLNoQuery" title="getSelfURLNoQuery :: Returns the URL of the current host + current view.">
            <span class="description">Returns the URL of the current host + current view.</span><pre>getSelfURLNoQuery</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_getSelfURL" title="getSelfURL :: Returns the URL of the current host + current view + query.">
            <span class="description">Returns the URL of the current host + current view + query.</span><pre>getSelfURL</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_generateUniqueID" title="generateUniqueID :: Generates an unique string (used for example as ID for assertions).">
            <span class="description">Generates an unique string (used for example as ID for assertions).</span><pre>generateUniqueID</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_parseTime2SAML" title="parseTime2SAML :: Converts a UNIX timestamp to SAML2 timestamp on the form
yyyy-mm-ddThh:mm:ss(\.s+)?Z.">
            <span class="description">Converts a UNIX timestamp to SAML2 timestamp on the form
yyyy-mm-ddThh:mm:ss(\.s+)?Z.</span><pre>parseTime2SAML</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_parseSAML2Time" title="parseSAML2Time :: Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z
to a UNIX timestamp. The sub-second part is ignored.">
            <span class="description">Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z
to a UNIX timestamp. The sub-second part is ignored.</span><pre>parseSAML2Time</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_parseDuration" title="parseDuration :: Interprets a ISO8601 duration value relative to a given timestamp.">
            <span class="description">Interprets a ISO8601 duration value relative to a given timestamp.</span><pre>parseDuration</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_getExpireTime" title="getExpireTime :: Compares 2 dates and returns the earliest.">
            <span class="description">Compares 2 dates and returns the earliest.</span><pre>getExpireTime</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_query" title="query :: Extracts nodes from the DOMDocument.">
            <span class="description">Extracts nodes from the DOMDocument.</span><pre>query</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_isSessionStarted" title="isSessionStarted :: Checks if the session is started or not.">
            <span class="description">Checks if the session is started or not.</span><pre>isSessionStarted</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_deleteLocalSession" title="deleteLocalSession :: Deletes the local session.">
            <span class="description">Deletes the local session.</span><pre>deleteLocalSession</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_calculateX509Fingerprint" title="calculateX509Fingerprint :: Calculates the fingerprint of a x509cert.">
            <span class="description">Calculates the fingerprint of a x509cert.</span><pre>calculateX509Fingerprint</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_formatFingerPrint" title="formatFingerPrint :: Formates a fingerprint.">
            <span class="description">Formates a fingerprint.</span><pre>formatFingerPrint</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_generateNameId" title="generateNameId :: Generates a nameID.">
            <span class="description">Generates a nameID.</span><pre>generateNameId</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_getStatus" title="getStatus :: Gets Status from a Response.">
            <span class="description">Gets Status from a Response.</span><pre>getStatus</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_decryptElement" title="decryptElement :: Decrypts an encrypted element.">
            <span class="description">Decrypts an encrypted element.</span><pre>decryptElement</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_castKey" title="castKey :: Converts a XMLSecurityKey to the correct algorithm.">
            <span class="description">Converts a XMLSecurityKey to the correct algorithm.</span><pre>castKey</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_addSign" title="addSign :: Adds signature key and senders certificate to an element (Message or Assertion).">
            <span class="description">Adds signature key and senders certificate to an element (Message or Assertion).</span><pre>addSign</pre>
        </a>
    </li>

                                                                                                        <li class="method public">
        <a href="#method_validateSign" title="validateSign :: Validates a signature (Message or Assertion).">
            <span class="description">Validates a signature (Message or Assertion).</span><pre>validateSign</pre>
        </a>
    </li>

                                                </ul>
        </li>
        <li class="nav-header protected">» Protected
            <ul>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </ul>
        </li>
        <li class="nav-header private">» Private
            <ul>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </ul>
        </li>
        <li class="nav-header">
            <i class="icon-custom icon-constant"></i> Constants
            <ul>
                            </ul>
        </li>
    </ul>


        </div>

        <div class="span8">
            <div class="element class">
                <h1>OneLogin_Saml2_Utils</h1>
                <small style="display: block; text-align: right">
                                                        </small>
                <p class="short_description">Utils of OneLogin PHP Toolkit</p>
                <div class="details">
                    <div class="long_description">
                        <p>Defines several often used methods</p>
                    </div>
                    <table class="table table-bordered">
                                                                                                                                                                                                                                                            </table>

                    <h3><i class="icon-custom icon-method"></i> Methods</h3>
                                                                <a id="method_t"></a>
                        <div class="element clickable method public  method_t" data-toggle="collapse" data-target=".method_t .collapse">
                            <h2>Translates any string. Accepts args</h2>
                            <pre>t(string $msg, array $args = array()) : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$msg</h4>
                                                <code>string</code><p><p>Message to be translated</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$args</h4>
                                                <code>array</code><p><p>Arguments</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>$translatedMsg  Translated text</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_validateXML"></a>
                        <div class="element clickable method public  method_validateXML" data-toggle="collapse" data-target=".method_validateXML .collapse">
                            <h2>This function attempts to validate an XML string against the specified schema.</h2>
                            <pre>validateXML(string $xml, string $schema, boolean $debug = false) : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"><p>It will parse the string into a DOM document and validate this document against the schema.</p></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$xml</h4>
                                                <code>string</code><p><p>The XML string or document which should be validated.</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$schema</h4>
                                                <code>string</code><p><p>The schema filename which should be used.</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$debug</h4>
                                                <code>boolean</code><p><p>To disable/enable the debug mode</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>| DOMDocument $dom  string that explains the problem or the DOMDocument</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_formatCert"></a>
                        <div class="element clickable method public  method_formatCert" data-toggle="collapse" data-target=".method_formatCert .collapse">
                            <h2>Returns a x509 cert (adding header &amp; footer if required).</h2>
                            <pre>formatCert(string $cert, boolean $heads = true) : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$cert</h4>
                                                <code>string</code><p><p>A x509 unformated cert</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$heads</h4>
                                                <code>boolean</code><p><p>True if we want to include head and footer</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>$x509 Formated cert</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="formatPrivateKey"></a>
                        <div class="element clickable method public  method_formatPrivateKey" data-toggle="collapse" data-target=".method_formatPrivateKey .collapse">
                            <h2>Returns a private key (adding header &amp; footer if required).</h2>
                            <pre>formatPrivateKey(string $key, boolean $heads = true) : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$key</h4>
                                                <code>string</code><p><p>A private key</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$heads</h4>
                                                <code>boolean</code><p><p>True if we want to include head and footer</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>$rsaKey Formated private key</p></p>
                                                                    </div>
                            </div>
                        </div>


                                            <a id="method_redirect"></a>
                        <div class="element clickable method public  method_redirect" data-toggle="collapse" data-target=".method_redirect .collapse">
                            <h2>Executes a redirection to the provided url (or return the target url).</h2>
                            <pre>redirect(string $url, array $parameters = array(), boolean $stay = false) : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$url</h4>
                                                <code>string</code><p><p>The target url</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$parameters</h4>
                                                <code>array</code><p><p>Extra parameters to be passed as part of the url</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$stay</h4>
                                                <code>boolean</code><p><p>True if we want to stay (returns the url string) False to redirect</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>$url</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_getSelfURLhost"></a>
                        <div class="element clickable method public  method_getSelfURLhost" data-toggle="collapse" data-target=".method_getSelfURLhost .collapse">
                            <h2>Returns the protocol + the current host + the port (if different than
common ports).</h2>
                            <pre>getSelfURLhost() : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                    
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>$url</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_getSelfHost"></a>
                        <div class="element clickable method public  method_getSelfHost" data-toggle="collapse" data-target=".method_getSelfHost .collapse">
                            <h2>Returns the current host.</h2>
                            <pre>getSelfHost() : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                    
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>$currentHost The current host</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_isHTTPS"></a>
                        <div class="element clickable method public  method_isHTTPS" data-toggle="collapse" data-target=".method_isHTTPS .collapse">
                            <h2>Checks if https or http.</h2>
                            <pre>isHTTPS() : boolean</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                    
                                                                            <h3>Response</h3>
                                        <code>boolean</code><p><p>$isHttps  False if https is not active</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_getSelfURLNoQuery"></a>
                        <div class="element clickable method public  method_getSelfURLNoQuery" data-toggle="collapse" data-target=".method_getSelfURLNoQuery .collapse">
                            <h2>Returns the URL of the current host + current view.</h2>
                            <pre>getSelfURLNoQuery() : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                    
                                                                            <h3>Response</h3>
                                        <code>string</code><p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_getSelfURL"></a>
                        <div class="element clickable method public  method_getSelfURL" data-toggle="collapse" data-target=".method_getSelfURL .collapse">
                            <h2>Returns the URL of the current host + current view + query.</h2>
                            <pre>getSelfURL() : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                    
                                                                            <h3>Response</h3>
                                        <code>string</code><p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_generateUniqueID"></a>
                        <div class="element clickable method public  method_generateUniqueID" data-toggle="collapse" data-target=".method_generateUniqueID .collapse">
                            <h2>Generates an unique string (used for example as ID for assertions).</h2>
                            <pre>generateUniqueID() : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                    
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>A unique string</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_parseTime2SAML"></a>
                        <div class="element clickable method public  method_parseTime2SAML" data-toggle="collapse" data-target=".method_parseTime2SAML .collapse">
                            <h2>Converts a UNIX timestamp to SAML2 timestamp on the form
yyyy-mm-ddThh:mm:ss(\.s+)?Z.</h2>
                            <pre>parseTime2SAML(string $time) : \$timestamp</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$time</h4>
                                                <code>string</code><p><p>The time we should convert (DateTime).</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>\$timestamp</code><p><p>SAML2 timestamp.</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_parseSAML2Time"></a>
                        <div class="element clickable method public  method_parseSAML2Time" data-toggle="collapse" data-target=".method_parseSAML2Time .collapse">
                            <h2>Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z
to a UNIX timestamp. The sub-second part is ignored.</h2>
                            <pre>parseSAML2Time(string $time) : \$timestamp</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$time</h4>
                                                <code>string</code><p><p>The time we should convert (SAML Timestamp).</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>\$timestamp</code><p><p>Converted to a unix timestamp.</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_parseDuration"></a>
                        <div class="element clickable method public  method_parseDuration" data-toggle="collapse" data-target=".method_parseDuration .collapse">
                            <h2>Interprets a ISO8601 duration value relative to a given timestamp.</h2>
                            <pre>parseDuration(string $duration, int $timestamp = null) : int</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$duration</h4>
                                                <code>string</code><p><p>The duration, as a string.</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$timestamp</h4>
                                                <code>int</code><p><p>The unix timestamp we should apply the</p>
<pre><code>                     duration to. Optional, default to the
                     current time.</code></pre></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>int</code><p><p>The new timestamp, after the duration is applied.</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_getExpireTime"></a>
                        <div class="element clickable method public  method_getExpireTime" data-toggle="collapse" data-target=".method_getExpireTime .collapse">
                            <h2>Compares 2 dates and returns the earliest.</h2>
                            <pre>getExpireTime(string $cacheDuration = null, string $validUntil = null) : int</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$cacheDuration</h4>
                                                <code>string</code><p><p>The duration, as a string.</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$validUntil</h4>
                                                <code>string</code><p><p>The valid until date, as a string or as a timestamp</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>int</code><p><p>$expireTime  The expiration time.</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_query"></a>
                        <div class="element clickable method public  method_query" data-toggle="collapse" data-target=".method_query .collapse">
                            <h2>Extracts nodes from the DOMDocument.</h2>
                            <pre>query(\DOMDocument $dom, string $query, \DomElement $context = null) : \DOMNodeList</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$dom</h4>
                                                <code>\DOMDocument</code><p><p>The DOMDocument</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$query</h4>
                                                <code>string</code><p><p>Xpath Expresion</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$context</h4>
                                                <code>\DomElement</code><p><p>Context Node (DomElement)</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>\DOMNodeList</code><p><p>The queried nodes</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_isSessionStarted"></a>
                        <div class="element clickable method public  method_isSessionStarted" data-toggle="collapse" data-target=".method_isSessionStarted .collapse">
                            <h2>Checks if the session is started or not.</h2>
                            <pre>isSessionStarted() : boolean</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                    
                                                                            <h3>Response</h3>
                                        <code>boolean</code><p><p>true if the sessíon is started</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_deleteLocalSession"></a>
                        <div class="element clickable method public  method_deleteLocalSession" data-toggle="collapse" data-target=".method_deleteLocalSession .collapse">
                            <h2>Deletes the local session.</h2>
                            <pre>deleteLocalSession() </pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                    
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_calculateX509Fingerprint"></a>
                        <div class="element clickable method public  method_calculateX509Fingerprint" data-toggle="collapse" data-target=".method_calculateX509Fingerprint .collapse">
                            <h2>Calculates the fingerprint of a x509cert.</h2>
                            <pre>calculateX509Fingerprint(string $x509cert) : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$x509cert</h4>
                                                <code>string</code><p><p>x509 cert</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>Formated fingerprint</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_formatFingerPrint"></a>
                        <div class="element clickable method public  method_formatFingerPrint" data-toggle="collapse" data-target=".method_formatFingerPrint .collapse">
                            <h2>Formates a fingerprint.</h2>
                            <pre>formatFingerPrint(string $fingerprint) : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$fingerprint</h4>
                                                <code>string</code><p><p>fingerprint</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>Formated fingerprint</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_generateNameId"></a>
                        <div class="element clickable method public  method_generateNameId" data-toggle="collapse" data-target=".method_generateNameId .collapse">
                            <h2>Generates a nameID.</h2>
                            <pre>generateNameId(string $value, string $spnq, string $format, string $key = null) : string</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$value</h4>
                                                <code>string</code><p><p>fingerprint</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$spnq</h4>
                                                <code>string</code><p><p>SP Name Qualifier</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$format</h4>
                                                <code>string</code><p><p>SP Format</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$key</h4>
                                                <code>string</code><p><p>SP Key to encrypt the nameID</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>string</code><p><p>$nameIDElement DOMElement | XMLSec nameID</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_getStatus"></a>
                        <div class="element clickable method public  method_getStatus" data-toggle="collapse" data-target=".method_getStatus .collapse">
                            <h2>Gets Status from a Response.</h2>
                            <pre>getStatus(\DomElement $dom) : array</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$dom</h4>
                                                <code>\DomElement</code><p><p>The Response as XML</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>array</code><p><p>$status The Status, an array with the code and a message.</p></p>
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_decryptElement"></a>
                        <div class="element clickable method public  method_decryptElement" data-toggle="collapse" data-target=".method_decryptElement .collapse">
                            <h2>Decrypts an encrypted element.</h2>
                            <pre>decryptElement(\DOMElement $encryptedData, \XMLSecurityKey $inputKey) : \DOMElement</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$encryptedData</h4>
                                                <code>\DOMElement</code><p><p>The encrypted data.</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$inputKey</h4>
                                                <code>\XMLSecurityKey</code><p><p>The decryption key.</p></p>
                                            </div>
                                                                            
                                                                            <h3>Response</h3>
                                        <code>\DOMElement</code><p><p>The decrypted element.</p></p>
                                                                    </div>
                            </div>
                        </div>


                                            <a id="method_castKey"></a>
                        <div class="element clickable method public  method_castKey" data-toggle="collapse" data-target=".method_castKey .collapse">
                            <h2>Converts a XMLSecurityKey to the correct algorithm.</h2>
                            <pre>castKey(XMLSecurityKey $key, $algorithm, $type = 'public')</pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$key</h4>
                                                <code>XMLSecurityKey</code><p><p>The key</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$algorithm</h4>
                                                <code>string</code><p><p>The desired algorithm</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$type</h4>
                                                <code>string</code><p><p>Public or private key, defaults to public.</p></p>
                                            </div>
                                                                            
                                                                    </div>
                            </div>
                        </div>


                                            <a id="method_addSign"></a>
                        <div class="element clickable method public  method_addSign" data-toggle="collapse" data-target=".method_addSign .collapse">
                            <h2>Adds signature key and senders certificate to an element (Message or Assertion).</h2>
                            <pre>addSign(string|\DomDocument $xml, string $key, string $cert) </pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$xml</h4>
                                                <code>string|\DomDocument</code><p><p>The element we should sign</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$key</h4>
                                                <code>string</code><p><p>The private key</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$cert</h4>
                                                <code>string</code><p><p>The public</p></p>
                                            </div>
                                                                            
                                                                    </div>
                            </div>
                        </div>
                                            <a id="method_validateSign"></a>
                        <div class="element clickable method public  method_validateSign" data-toggle="collapse" data-target=".method_validateSign .collapse">
                            <h2>Validates a signature (Message or Assertion).</h2>
                            <pre>validateSign(string|\DomDocument $xml, string|null $cert = null, string|null $fingerprint = null) </pre>
                            <div class="labels">
                                                                <span class="label">static</span>                                                                                                                            </div>
                            <div class="row collapse">
                                <div class="detail-description">
                                    <div class="long_description"></div>

                                    <table class="table">
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                                    <tr>
                                                <th>
                                                    
                                                </th>
                                                <td>
                                                                                                    </td>
                                            </tr>
                                                                            </table>

                                                                            <h3>Arguments</h3>
                                                                                    <div class="subelement argument">
                                                <h4>$xml</h4>
                                                <code>string|\DomDocument</code><p><p>The element we should validate</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$cert</h4>
                                                <code>string|null</code><p><p>The pubic cert</p></p>
                                            </div>
                                                                                    <div class="subelement argument">
                                                <h4>$fingerprint</h4>
                                                <code>string|null</code><p><p>The fingerprint of the public cert</p></p>
                                            </div>
                                                                            
                                                                    </div>
                            </div>
                        </div>
                    
                    
                                                        </div>
            </div>
            <a id="\OneLogin_Saml2_Utils"></a>
            <ul class="breadcrumb">
                <li><a href="../index.html"><i class="icon-custom icon-class"></i></a></li>
                    
    
    <li><span class="divider">\</span><a href="../namespaces/default.html">\</a></li>

                <li class="active"><span class="divider">\</span><a href="../classes/OneLogin_Saml2_Utils.html">OneLogin_Saml2_Utils</a></li>
            </ul>
        </div>
    </div>

    </div>

        <footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by
            <a href="http://glyphicons.com/">Glyphicons</a>.<br/>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and<br/>
            generated on Mon, 14 Apr 2014 20:25:56 +0100.<br/>
    </footer>
    </body>
</html>
